﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:Controls="clr-namespace:PSE.Framework.UI.Controls.SmartClient;assembly=PSE.Framework.UI.Controls">

    <!--BEGIN DATEPICKER-->
    <Style x:Key="ControlDatePickerWeekDays" TargetType="{x:Type ListBox}">
        <Setter Property="BorderBrush" Value="{DynamicResource BrushDatePickerWeekBorder}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Background" Value="{DynamicResource BrushDatePickerWeekBackground}"/>
        <Setter Property="Foreground" Value="{DynamicResource BrushDatePickerWeekDaysForeground}"/>
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="ItemContainerStyle" Value="{DynamicResource ControlDatePickerWeekDay}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ListBox}">
                    <Border x:Name="Bd" SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="1">
                        <ScrollViewer Padding="{TemplateBinding Padding}">
                            <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                        </ScrollViewer>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ControlDatePickerButtonCalendar" TargetType="{x:Type Button}">
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Grid Width="19" Height="19">
                        <Rectangle x:Name="Background" Fill="{DynamicResource BrushDatePickerButtonCalendarBackground}" Stroke="{x:Null}" RadiusX="1.674" RadiusY="1.674" Margin="0.614,2.452,0.675,0.65"/>
                        <Path x:Name="BackgroundTop" Fill="{DynamicResource BrushDatePickerButtonCalendarTopBackground}" Stretch="Fill" Stroke="{x:Null}" Margin="0.358,0.303,0.558,0" VerticalAlignment="Top" Height="3.667" Data="M200.76634,113.81284 L202.16699,112.33367 217.41282,112.33367 218.8291,113.75002 218.8291,115.99985 200.75035,115.99985 z"/>
                        <Rectangle x:Name="Border" Fill="{x:Null}" Stroke="{DynamicResource BrushDatePickerButtonCalendarBorder}" RadiusX="2" RadiusY="2"/>
                        <Rectangle x:Name="Day1" Fill="{DynamicResource BrushDatePickerButtonCalendarDayBackground}" Stroke="{x:Null}" RadiusX="0" RadiusY="0" Width="3" Height="3" RenderTransformOrigin="-1.64,-1.5" HorizontalAlignment="Left" Margin="1.915,5.124,0,0" VerticalAlignment="Top"/>
                        <Rectangle x:Name="Day2" Fill="{DynamicResource BrushDatePickerButtonCalendarDayBackground}" Stroke="{x:Null}" RadiusX="0" RadiusY="0" Width="3" Height="3" RenderTransformOrigin="-1.64,-1.5" HorizontalAlignment="Left" Margin="5.815,5.124,0,0" VerticalAlignment="Top"/>
                        <Rectangle x:Name="Day3" Fill="{DynamicResource BrushDatePickerButtonCalendarDayBackground}" Stroke="{x:Null}" RadiusX="0" RadiusY="0" Width="3" Height="3" RenderTransformOrigin="-1.64,-1.5" HorizontalAlignment="Right" Margin="0,5.124,6.169,0" VerticalAlignment="Top"/>
                        <Rectangle x:Name="Day4" Fill="{DynamicResource BrushDatePickerButtonCalendarDayBackground}" Stroke="{x:Null}" RadiusX="0" RadiusY="0" Width="3" Height="3" RenderTransformOrigin="-1.64,-1.5" HorizontalAlignment="Right" Margin="0,5.124,2.153,0" VerticalAlignment="Top" StrokeThickness="1"/>
                        <Rectangle x:Name="Day5" Fill="{DynamicResource BrushDatePickerButtonCalendarDayBackground}" Stroke="{x:Null}" RadiusX="0" RadiusY="0" Width="3" RenderTransformOrigin="-1.64,-1.5" HorizontalAlignment="Left" Margin="1.915,9.182,0,6.818"/>
                        <Rectangle x:Name="Day6" Fill="{DynamicResource BrushDatePickerButtonCalendarDayBackground}" Stroke="{x:Null}" RadiusX="0" RadiusY="0" Width="3" RenderTransformOrigin="-1.64,-1.5" HorizontalAlignment="Left" Margin="5.815,9.182,0,6.818"/>
                        <Rectangle x:Name="Day7" Fill="{DynamicResource BrushDatePickerButtonCalendarDayBackground}" Stroke="{DynamicResource BrushDatePickerButtonCalendarDaySelectedBorder}" RadiusX="0" RadiusY="0" Width="3" RenderTransformOrigin="-1.64,-1.5" HorizontalAlignment="Right" Margin="0,9.182,6.169,6.818" StrokeThickness="0.5"/>
                        <Rectangle x:Name="Day8" Fill="{DynamicResource BrushDatePickerButtonCalendarDayBackground}" Stroke="{x:Null}" RadiusX="0" RadiusY="0" Width="3" RenderTransformOrigin="-1.64,-1.5" HorizontalAlignment="Right" Margin="0,9.182,2.153,6.818" StrokeThickness="1"/>
                        <Rectangle x:Name="Day9" Fill="{DynamicResource BrushDatePickerButtonCalendarDayBackground}" Stroke="{x:Null}" RadiusX="0" RadiusY="0" Width="3" Height="3" RenderTransformOrigin="-1.64,-1.5" HorizontalAlignment="Left" Margin="1.915,0,0,2.876" VerticalAlignment="Bottom"/>
                        <Rectangle x:Name="Day10" Fill="{DynamicResource BrushDatePickerButtonCalendarDayBackground}" Stroke="{x:Null}" RadiusX="0" RadiusY="0" Width="3" Height="3" RenderTransformOrigin="-1.64,-1.5" HorizontalAlignment="Left" Margin="5.815,0,0,2.876" VerticalAlignment="Bottom"/>
                        <Rectangle x:Name="Day11" Fill="{DynamicResource BrushDatePickerButtonCalendarDayBackground}" Stroke="{x:Null}" RadiusX="0" RadiusY="0" Width="3" Height="3" RenderTransformOrigin="-1.64,-1.5" HorizontalAlignment="Right" Margin="0,0,6.169,2.876" VerticalAlignment="Bottom"/>
                        <Rectangle x:Name="Day12" Fill="{DynamicResource BrushDatePickerButtonCalendarDayBackground}" Stroke="{x:Null}" RadiusX="0" RadiusY="0" Width="3" Height="3" RenderTransformOrigin="-1.64,-1.5" HorizontalAlignment="Right" Margin="0,0,2.153,2.876" VerticalAlignment="Bottom" StrokeThickness="1"/>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsKeyboardFocused" Value="true"/>
                        <Trigger Property="ToggleButton.IsChecked" Value="true"/>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Fill" Value="{DynamicResource BrushDatePickerButtonCalendarBackgroundDisabled}" TargetName="Background"/>
                            <Setter Property="Fill" Value="{DynamicResource BrushDatePickerButtonCalendarBackgroundTopDisabled}" TargetName="BackgroundTop"/>
                            <Setter Property="Stroke" Value="{DynamicResource BrushDatePickerButtonCalendarBorderDisabled}" TargetName="Border"/>
                            <Setter Property="Fill" Value="{DynamicResource BrushDatePickerButtonCalendarDayBackgroundDisabled}" TargetName="Day1"/>
                            <Setter Property="Fill" Value="{DynamicResource BrushDatePickerButtonCalendarDayBackgroundDisabled}" TargetName="Day2"/>
                            <Setter Property="Fill" Value="{DynamicResource BrushDatePickerButtonCalendarDayBackgroundDisabled}" TargetName="Day3"/>
                            <Setter Property="Fill" Value="{DynamicResource BrushDatePickerButtonCalendarDayBackgroundDisabled}" TargetName="Day4"/>
                            <Setter Property="Fill" Value="{DynamicResource BrushDatePickerButtonCalendarDayBackgroundDisabled}" TargetName="Day5"/>
                            <Setter Property="Fill" Value="{DynamicResource BrushDatePickerButtonCalendarDayBackgroundDisabled}" TargetName="Day6"/>
                            <Setter Property="Fill" Value="{DynamicResource BrushDatePickerButtonCalendarDayBackgroundDisabled}" TargetName="Day7"/>
                            <Setter Property="Fill" Value="{DynamicResource BrushDatePickerButtonCalendarDayBackgroundDisabled}" TargetName="Day8"/>
                            <Setter Property="Fill" Value="{DynamicResource BrushDatePickerButtonCalendarDayBackgroundDisabled}" TargetName="Day9"/>
                            <Setter Property="Fill" Value="{DynamicResource BrushDatePickerButtonCalendarDayBackgroundDisabled}" TargetName="Day10"/>
                            <Setter Property="Fill" Value="{DynamicResource BrushDatePickerButtonCalendarDayBackgroundDisabled}" TargetName="Day11"/>
                            <Setter Property="Fill" Value="{DynamicResource BrushDatePickerButtonCalendarDayBackgroundDisabled}" TargetName="Day12"/>
                            <Setter Property="Stroke" Value="{DynamicResource BrushDatePickerButtonCalendarDaySelectedBorderDisabled}" TargetName="Day7"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <Style x:Key="ControlDatePickerWeekDay" TargetType="{x:Type ListBoxItem}">
        <Setter Property="FontStyle" Value="Normal"/>
        <Setter Property="FontWeight" Value="Normal"/>
        <Setter Property="FontFamily" Value="Tahoma"/>
        <Setter Property="FontSize" Value="11"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ListBoxItem}">
                    <Border x:Name="Border" SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}">
                        <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsSelected" Value="true">
                            <Setter Property="Background" Value="{DynamicResource BrushDatePickerWeekDayBackgroundSelected}" TargetName="Border"/>
                            <Setter Property="Background" Value="Transparent"/>
                            <Setter Property="CornerRadius" Value="3" TargetName="Border"/>
                            <Setter Property="Margin" Value="0,2,0,0" TargetName="Border"/>
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter Property="Background" Value="{DynamicResource BrushDatePickerWeekDayBackgroundHover}" TargetName="Border"/>
                            <Setter Property="CornerRadius" Value="3" TargetName="Border"/>
                            <Setter Property="Margin" Value="0,2,0,0" TargetName="Border"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ControlDatePickerPopUpButton" TargetType="Button">
        <Setter Property="Background" Value="{DynamicResource BrushDatePickerPopUpButtonBackground}"/>
        <Setter Property="BorderBrush" Value="{DynamicResource BrushDatePickerPopUpButtonBorder}"/>
        <Setter Property="Foreground" Value="{DynamicResource BrushDatePickerPopUpButtonForeground}"/>
        <Setter Property="FontFamily" Value="Tahoma"/>
        <Setter Property="FontSize" Value="11"/>
        <Setter Property="FontWeight" Value="Normal"/>
        <Setter Property="FontStyle" Value="Normal"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Border BorderThickness="1" CornerRadius="3" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" SnapsToDevicePixels="False">
                        <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" RecognizesAccessKey="True"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="BorderBrush" Value="{DynamicResource BrushDatePickerPopUpButtonBorderMouseHover}"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Background" Value="{DynamicResource BrushDatePickerPopUpButtonBackgroundDisabled}"/>
                <Setter Property="TextElement.Foreground" Value="{DynamicResource BrushDatePickerPopUpButtonForegroundDisabled}"/>
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="ControlDatePickerPopUpButtonArrow" TargetType="Button" BasedOn="{StaticResource ControlDatePickerPopUpButton}">
        <Setter Property="FontFamily" Value="Times New Roman"/>
    </Style>

    <DataTemplate x:Key="ControlDatePickerCalendarDays" DataType="{x:Type Controls:CalendarDate}">
        <Border HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
            <Border x:Name="Border">
                <Label x:Name="TextBlock" Content="{Binding Date.Day}" Foreground="{DynamicResource BrushDatePickerDayForeground}" FontSize="11" HorizontalContentAlignment="Right" Width="25" Style="{DynamicResource ControlFont}" VerticalContentAlignment="Center"/>
            </Border>
        </Border>
        <DataTemplate.Triggers>
            <DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Controls:DatePicker}}, Path=modeCalendar}" Value="Week">
                <Setter Property="Content" Value="{Binding Date.Day}" TargetName="TextBlock"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Controls:DatePicker}}, Path=modeCalendar}" Value="Month">
                <Setter Property="Content" Value="{Binding .}" TargetName="TextBlock"/>
                <Setter Property="Padding" Value="0,5,0,5" TargetName="TextBlock"/>
                <Setter Property="Margin" Value="6,12,6,12" TargetName="Border"/>
                <Setter Property="HorizontalContentAlignment" Value="Center" TargetName="TextBlock"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Controls:DatePicker}}, Path=modeCalendar}" Value="Year">
                <Setter Property="Content" Value="{Binding .}" TargetName="TextBlock"/>
                <Setter Property="Width" Value="31" TargetName="TextBlock"/>
                <Setter Property="Padding" Value="0,5,0,5" TargetName="TextBlock"/>
                <Setter Property="HorizontalContentAlignment" Value="Center" TargetName="TextBlock"/>
            </DataTrigger>
            <!--Begin Other Month-->
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding IsOtherMonth}" Value="True"/>
                    <Condition Binding="{Binding IsWeekend}" Value="True"/>
                </MultiDataTrigger.Conditions>
                <Setter Property="Foreground" Value="{DynamicResource BrushDatePickerDayAnotherMonthWeekendForeground}" TargetName="TextBlock"/>
                <Setter Property="FontSize" Value="11" TargetName="TextBlock"/>
            </MultiDataTrigger>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding IsOtherMonth}" Value="True"/>
                    <Condition Binding="{Binding IsWeekend}" Value="False"/>
                </MultiDataTrigger.Conditions>
                <Setter Property="Foreground" Value="{DynamicResource BrushDatePickerDayAnotherMonthForeground}" TargetName="TextBlock"/>
                <Setter Property="FontSize" Value="11" TargetName="TextBlock"/>
            </MultiDataTrigger>
            <!--End Other Month-->

            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding IsOtherMonth}" Value="False"/>
                    <Condition Binding="{Binding IsWeekend}" Value="True"/>
                </MultiDataTrigger.Conditions>
                <Setter Property="Foreground" Value="{DynamicResource BrushDatePickerDayWeekendForeground}" TargetName="TextBlock"/>
            </MultiDataTrigger>

            <DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ListBoxItem}}, Path=IsSelected}" Value="True">
                <Setter Property="Background" Value="{DynamicResource BrushDatePickerDaySelectedBackground}" TargetName="Border"/>
                <Setter Property="CornerRadius" Value="2" TargetName="Border"/>
                <Setter Property="Foreground" Value="{DynamicResource BrushDatePickerDaySelectedForeground}" TargetName="TextBlock"/>
            </DataTrigger>

            <DataTrigger Binding="{Binding IsToday}" Value="True">
                <Setter Property="Foreground" Value="{DynamicResource BrushDatePickerDayCurrentForeground}" TargetName="TextBlock"/>
                <Setter Property="FontWeight" Value="Bold" TargetName="TextBlock"/>
                <Setter Property="Width" Value="25" TargetName="TextBlock"/>
            </DataTrigger>

            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Background" Value="{DynamicResource BrushDatePickerDaySelectedBackgroundHover}" TargetName="Border"/>
                <Setter Property="CornerRadius" Value="2" TargetName="Border"/>
                <Setter Property="Foreground" Value="{DynamicResource BrushDatePickerDaySelectedForegroundHover}" TargetName="TextBlock"/>
            </Trigger>

            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ListBoxItem}}, Path=IsSelected}" Value="True"/>
                    <Condition Binding="{Binding IsToday}" Value="True"/>
                </MultiDataTrigger.Conditions>
                <Setter Property="Background" Value="{DynamicResource BrushDatePickerDaySelectedBackgroundHover}" TargetName="Border"/>
                <Setter Property="CornerRadius" Value="2" TargetName="Border"/>
                <Setter Property="Foreground" Value="{DynamicResource BrushDatePickerDaySelectedForegroundHover}" TargetName="TextBlock"/>
            </MultiDataTrigger>
        </DataTemplate.Triggers>
    </DataTemplate>

    <Style TargetType="{x:Type Controls:DatePicker}">
        <Setter Property="Padding" Value="1"/>
        <Setter Property="Height" Value="21"/>
        <Setter Property="Width" Value="105"/>
        <Setter Property="Grid.IsSharedSizeScope" Value="true"/>
        <Setter Property="KeyboardNavigation.TabNavigation" Value="Local" />
        <Setter Property="Focusable" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Controls:DatePicker}">
                    <Grid Name="PART_RootGrid" Background="Transparent" HorizontalAlignment="Stretch" VerticalAlignment="Top">
                        <Border HorizontalAlignment="Stretch">
                            <Grid Grid.IsSharedSizeScope="{TemplateBinding Grid.IsSharedSizeScope}" HorizontalAlignment="Stretch">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition/>
                                    <ColumnDefinition Width="2"/>
                                    <ColumnDefinition Width="20"/>
                                </Grid.ColumnDefinitions>
                                <Controls:TextBox x:Name="Part_txtData" Grid.Column="0" Grid.ColumnSpan="1" VerticalAlignment="Top" HorizontalAlignment="Stretch" SnapsToDevicePixels="False" Width="Auto" MinWidth="75"/>
                                <Controls:Button Focusable="False" SnapsToDevicePixels="True" HorizontalAlignment="Right" VerticalAlignment="Top" x:Name="Part_btnAcima" Grid.Column="0" Margin="0,1,3,0" Style="{DynamicResource ControlButtonArrowUp}"/>
                                <Controls:Button Focusable="False" SnapsToDevicePixels="True" HorizontalAlignment="Right" VerticalAlignment="Bottom" x:Name="Part_btnAbaixo" Grid.Column="0" Margin="0,0,3,1" Style="{DynamicResource ControlButtonArrowDown}"/>
                                <Button x:Name="Part_btPopUp" Focusable="False" Grid.Column="2" Width="20" HorizontalAlignment="Right" Style="{DynamicResource ControlDatePickerButtonCalendar}"/>
                            </Grid>
                        </Border>
                        <Popup IsOpen="False" x:Name="Part_Calendar" Placement="Bottom" Width="212" Height="210" StaysOpen="False">
                            <Grid Background="{DynamicResource BrushDatePickerPopUpBackground}">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="23"/>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="23"/>
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="30"/>
                                    <RowDefinition Height="30"/>
                                    <RowDefinition Height="*"/>
                                </Grid.RowDefinitions>
                                <Button x:Name="Part_btBackward" Content="◄" Grid.Row="0" Grid.Column="0" Margin="0,3,0,2" Style="{DynamicResource ControlDatePickerPopUpButtonArrow}"/>
                                <Button x:Name="Part_btDay" Grid.Row="0" Grid.Column="1" Margin="1,3,1,2" Style="{DynamicResource ControlDatePickerPopUpButton}"/>
                                <Button x:Name="Part_btMonth" Grid.Row="0" Grid.Column="2" Margin="1,3,1,2" Style="{DynamicResource ControlDatePickerPopUpButton}"/>
                                <Button x:Name="Part_btYear" Grid.Row="0" Grid.Column="3" Margin="1,3,1,2" Style="{DynamicResource ControlDatePickerPopUpButton}"/>
                                <Button x:Name="Part_btForward" Content="►" Grid.Row="0" Grid.Column="4" Margin="1,3,1,2" Style="{DynamicResource ControlDatePickerPopUpButtonArrow}"/>
                                <ListBox x:Name="Part_Semana" Grid.Row="1" Grid.ColumnSpan="5" Style="{DynamicResource ControlDatePickerWeekDays}"/>
                                <Border BorderThickness="1,1,1,1" BorderBrush="{DynamicResource BrushDatePickerDaysBorder}" Grid.Row="2" Grid.ColumnSpan="5" Background="{x:Null}">
                                    <ListBox Grid.Row="2" Grid.ColumnSpan="3" 
                                        x:Name="Part_DP" 
                                        BorderThickness="0" 
                                        SelectionMode="Extended"
                                        IsTextSearchEnabled="false"
                                        SelectedIndex="-1"
                                        Background="{DynamicResource BrushDatePickerDaysBackground}"
                                        ItemTemplate="{DynamicResource ControlDatePickerCalendarDays}" BorderBrush="{x:Null}"
                                        >
                                        <ListBox.ItemsPanel>
                                            <ItemsPanelTemplate>
                                                <UniformGrid Columns="7" Width="Auto" Rows="6" Background="{DynamicResource BrushDatePickerGreen}" Margin="0,-50,0,0">
                                                </UniformGrid>
                                            </ItemsPanelTemplate>
                                        </ListBox.ItemsPanel>
                                    </ListBox>
                                </Border>
                            </Grid>
                        </Popup>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="ErrorTemplate">
            <Setter.Value>
                <ControlTemplate>
                    <Grid HorizontalAlignment="Stretch" VerticalAlignment="Top">
                        <Border HorizontalAlignment="Stretch">
                            <Grid Grid.IsSharedSizeScope="{TemplateBinding Grid.IsSharedSizeScope}" HorizontalAlignment="Stretch">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition/>
                                    <ColumnDefinition Width="2"/>
                                    <ColumnDefinition Width="20"/>
                                </Grid.ColumnDefinitions>
                                <Border Grid.Column="0" BorderBrush="{DynamicResource BrushDatePickerBorderError}" BorderThickness="1" CornerRadius="4" HorizontalAlignment="Stretch" Height="{Binding ActualHeight, ElementName=PART_Content}" MinWidth="83">
                                </Border>
                                <AdornedElementPlaceholder Grid.Column="0" Grid.ColumnSpan="3" x:Name="PART_Content" VerticalAlignment="Top" HorizontalAlignment="Left"/>
                            </Grid>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ControlDataGridDatePicker" TargetType="{x:Type Controls:DatePicker}" BasedOn="{StaticResource {x:Type Controls:DatePicker}}">
        <Setter Property="Padding" Value="0,0,2,0" />
        <Setter Property="Width" Value="Auto"/>
        <Setter Property="HorizontalAlignment" Value="Stretch"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="Border.CornerRadius" Value="0"/>
        <Setter Property="ErrorTemplate">
            <Setter.Value>
                <ControlTemplate>
                    <Grid HorizontalAlignment="Stretch" VerticalAlignment="Top">
                        <Border HorizontalAlignment="Stretch">
                            <Grid Grid.IsSharedSizeScope="{TemplateBinding Grid.IsSharedSizeScope}" HorizontalAlignment="Stretch">
                                <Border Grid.Column="0" BorderBrush="{DynamicResource BrushDatePickerBorderError}" BorderThickness="1" CornerRadius="0" HorizontalAlignment="Stretch" Height="{Binding ActualHeight, ElementName=PART_Content}">
                                </Border>
                                <AdornedElementPlaceholder Grid.Column="0" x:Name="PART_Content" VerticalAlignment="Top" HorizontalAlignment="Left"/>
                            </Grid>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <!--END DATEPICKER-->
</ResourceDictionary>